/* HMAC-SHA256: Keyed-Hashing for Message Authentication
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2, or (at your option) any
 * later version.
 */


#ifndef __HMAC_SHA256__
#define __HMAC_SHA256__

#include <stdint.h>
#include "sha256.h"

#define HMAC_SHA256_SIZE SHA256_32

struct HmacSha256Context
{
	uint8_t key[64];	// 64-byte key
	struct SHA256Context hash;
};

void HmacSha256Init(struct HmacSha256Context *ctx, const void *key, unsigned int len);
void HmacSha256Update(struct HmacSha256Context *ctx, const void *data, unsigned int len);
void HmacSha256Final(unsigned char digest[32], struct HmacSha256Context *ctx);
void HmacSha256HexString(char hex[65], const unsigned char digest[32]);

#endif
